import axios from 'axios';

const instance = axios.create({
  baseURL: 'https://ke8lrozr.api.lncld.net/1.1',
  timeout: 1000,
  headers: {
    // 'X-Custom-Header': 'sintro',
    'X-LC-Id': 'Ke8lrOzrmc3XRQHPF3hLg15A-gzGzoHsz',
    'X-LC-Key': '9o1RucA9E0LISe1cwwf7kyXv',
  },
});
// 添加请求拦截器
instance.interceptors.request.use((config) => {
  return config;
}, (error) => {
  return Promise.reject(error);
});

instance.interceptors.response.use((response) => {
  return response.data;
}, (error) => {
  return Promise.reject(error.response.data);
});

export default instance;
